$(function () {
    // onLoadTime();
});
function getTime(){
    var now= new Date();
    var year=now.getFullYear();
    var month=now.getMonth()+1>9?now.getMonth()+1:'0'+(now.getMonth()+1);
    var day=now.getDate()>9?now.getDate():'0'+now.getDate();
    var hour=now.getHours()>9?now.getHours():'0'+now.getHours();
    var minute=now.getMinutes()>9?now.getMinutes():'0'+now.getMinutes();
    var second=now.getSeconds()>9?now.getSeconds():'0'+now.getSeconds();
    return year+"-"+month+"-"+day+" "+hour+":"+minute+":"+second;
}

/*当前时间显示*/
function onLoadTime(){
    var timeStr = getTime();
    document.getElementById('time').innerHTML = timeStr;
    setTimeout(onLoadTime,1000);
}